package com.blackitheima1.InnerDemo.test6;
//匿名内部类--游泳接口
public class TestSwimming {
    public static void main(String[] args) {
        //调用方法,使用匿名内部类
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("黑子,我命由我不由天!");
                System.out.println("我们去裸奔!");
            }
        });

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}

//接口
interface Swimming{
    public abstract void swim();
}